<% content_for :location do %>
	<li>&raquo; <%= link_to @forum.category.name, category_path(@forum.category) %></li>
	<li>&raquo; <%= @forum.name %></li>
<% end %>

<% if logged_in? %>
<div class="user_actions">
	<%= link_to _('New Topic'), forum_new_topic_path(@forum) %>
</div>
<% end %>
<div class="clearer"></div>

<div class="<%= dom_class(@forum) %>" id="<%= dom_id(@forum) %>">
	<table class="box" cellspacing="0">
		<thead>
			<tr>
				<th class="coL1"><%=_ 'Topic' %></th>
				<th class="col2"><%=_ 'Author' %></th>
				<th class='col3'><%=_ 'Replies' %></th>
				<th class="col3"><%=_ 'Views' %></th>
				<th class='col4'><%=_ 'Last reply' %></th>
			</tr>
		</thead>
		<tbody>
			<% for topic in @topics %>
			<tr>
				<td class="col1">
					<%= link_to h(topic.title), forum_topic_path(@forum, topic) %>
				</td>
				<td class="col2"><%= link_to h(topic.user.login), user_path(topic.user) %></td>
				<td class="col3"><%= topic.posts_count %></td>
				<td class="col3"><%= topic.hits %></td>
				<td class="col4">
					<% unless topic.replied_by.nil? %>
					<%= "#{topic.replied_at.to_s(:db)} by #{topic.replied_by_user.login}"%>
					<% else %>
					&nbsp;
					<% end %>
				</td>
			</tr>
			<% end %>
		</tbody>
	</table>
</div>